Enable file locking support for Hurd
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 16 Dec 2025 10:45:36 +0000 (11:45 +0100)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Wed, 8 Apr 2026 17:02:02 +0000 (19:02 +0200)
like Illumos in #148322, Hurd was missed when originally introducing locking
gates per target OS in #132977. building rustc on Hurd was broken as a result
since 1.91.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name Enable-file-locking-support-for-Hurd.patch

library/std/src/fs/tests.rs
library/std/src/sys/fs/unix.rs

index 0a5d1153d860c4743528fe908d2a66153d6e97e4..f15efc7b2f0b083d40ed266a791597e728bbb53d 100644 (file)
@@ -212,6 +212,7 @@ fn file_test_io_seek_and_write() {
         target_os = "cygwin",
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "illumos",
         target_os = "linux",
         target_os = "netbsd",
@@ -244,6 +245,7 @@ fn file_lock_multiple_shared() {
         target_os = "cygwin",
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "illumos",
         target_os = "linux",
         target_os = "netbsd",
@@ -277,6 +279,7 @@ fn file_lock_blocking() {
         target_os = "cygwin",
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "illumos",
         target_os = "linux",
         target_os = "netbsd",
@@ -307,6 +310,7 @@ fn file_lock_drop() {
         target_os = "cygwin",
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "illumos",
         target_os = "linux",
         target_os = "netbsd",
index 47d9ee226653e7b021158d8de0c8cbddf801ad59..52c892571aaf1c95aed682d829c659cf8c481ece 100644 (file)
@@ -1291,6 +1291,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1316,6 +1317,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1332,6 +1334,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1357,6 +1360,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1373,6 +1377,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1414,6 +1419,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1433,6 +1439,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1474,6 +1481,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1493,6 +1501,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1518,6 +1527,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",